package org.manon.json.hierarchy;

import java.util.List;

import org.manon.json.annotation.JSon;
import org.manon.json.annotation.JSonDiscriminator;
import org.manon.json.annotation.JSonDiscriminatorType;

@JSon
public class ParentB {

	private String name;
	private List<Child_ParentB> _childs;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public List<Child_ParentB> getChilds() {
		return _childs;
	}
	public void setChilds(List<Child_ParentB> childs) {
		_childs = childs;
	}
	
	@JSon(filterable = false)
	@JSonDiscriminator( type = JSonDiscriminatorType.CLASS_NAME , name = "DI")
	public static class Child_ParentB {
		private String _common;
		public String getCommon() {
			return _common;
		}
		public void setCommon(String common) {
			_common = common;
		}
	}
	
	@JSon
	public static class Child_ParentB_A extends Child_ParentB {
		private String _field;
		public String getField() {
			return _field;
		}
		public void setField(String field) {
			_field = field;
		}
	}
	
	@JSon
	public static class Child_ParentB_AA extends Child_ParentB_A {
		private String _fieldA;
		public String getFieldA() {
			return _fieldA;
		}
		public void setFieldA(String field) {
			_fieldA = field;
		}
	}
	
	@JSon
	public static class Child_ParentB_AB extends Child_ParentB_A {
		private String _fieldB;
		public String getFieldB() {
			return _fieldB;
		}
		public void setFieldB(String field) {
			_fieldB = field;
		}
	}
	
	@JSon
	public static class Child_ParentB_B extends Child_ParentB {
		private String _method;
		public String getMethod() {
			return _method;
		}
		public void setMethod(String method) {
			_method = method;
		}
	}
}